package com.naiterui.ehp.bs.emr.repository.mongo;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import com.naiterui.common.repository.core.BaseMongoRepository;
import com.naiterui.ehp.bs.emr.entity.mongo.MedicalRecordTemplate;

/**
 * 病历模板
 * 
 * @author yangfuya
 * @since 2022/4/11
 */
@Repository
public interface MedicalRecordTemplateRepository extends BaseMongoRepository<MedicalRecordTemplate, String> {

    /**
     * 获取医生的病历模板
     * 
     * @param doctorId
     * @param pageable
     * @return
     */
    Page<MedicalRecordTemplate> findByDoctorIdOrderByCreateAtDesc(Long doctorId, Pageable pageable);

    /**
     * 根据医生ID和模板名称查询
     * 
     * @param doctorId
     * @param name
     * @return
     */
    MedicalRecordTemplate findByDoctorIdAndName(Long doctorId, String name);

    /**
     * 根据ID和医生ID获取模板详情
     * 
     * @param id
     * @param doctorId
     * @return
     */
    MedicalRecordTemplate findByIdAndDoctorId(String id, Long doctorId);
}
